package ru.pbem.olympia.core;

import ru.pbem.olympia.utils.Hierarchy;
import ru.pbem.olympia.utils.MapHierarchy;

/**
 * User: Roman Pavlov
 * Date: 09-Sep-2010
 * Time: 19:22:58
 */
public class GameRegistry implements Registry {
    private static final Identity FACTION_KEY = new StringId("$faction$");
    private static final Identity SCIENCE_KEY = new StringId("$science$");
    private static final Identity MAP_KEY = new StringId("$map$");

    private Hierarchy<Identity, Entity> registry = new MapHierarchy<Identity, Entity>();

    public GameRegistry() {
        this.registry.addNode(GameRegistry.MAP_KEY, new GenericEntity("Map", null), null);
    }

    public Object getFaction() {
        return registry.getNode(GameRegistry.FACTION_KEY);
    }

    public Object getMap() {
        return registry.getNode(GameRegistry.MAP_KEY);
    }

    public Object getScience() {
        return registry.getNode(GameRegistry.SCIENCE_KEY);
    }
}
